﻿using System;
using System.Collections.Generic;
using System.Drawing.Drawing2D;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace NeonLampTest.Common
{
    public class TopNode : SurroundNodeBase
    {
        public TopNode()
        {
        }
        public override void Change()
        {
            X = Y = 0;
            Displacement += Step;
            if (Displacement > Width)
                Displacement = Width;
            ChangeEndColor();
        }
        public override void Draw(Graphics g)
        {
            Rectangle rectangle = new Rectangle(0, 0, Displacement, SurroundWidth);
            using (LinearGradientBrush bh = new LinearGradientBrush(rectangle, EndColor , StartColor, LinearGradientMode.Horizontal))
            {
                g.FillRectangle(bh, rectangle);
            }
        }
    }
}
